#include<bits/stdc++.h>
#define pii pair<long long,long long>
#define mp make_pair
#define pb push_back
using namespace std;
long long n;
long long h[100005];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        int t;
        cin>>t;
        h[t]++;
    }
    long long ans=0,l=0;
    for(int i=1;i<=100000;i++){
        long long de=min(l,h[i]);
        ans+=de;
        l-=de;
        l+=h[i];
    }
    cout<<n-ans;
    return 0;
}
